<template>
	<view style="padding: 20rpx; background-color: #fff;">
		<view class="text-area" style="margin-bottom: 20rpx;">
			<text style="font-size: 32rpx; font-weight: 500;">输入值:</text>
			<input type="text" v-model="title"
				style="background-color: #e6e6e6; color: red; font-weight: bold; 
				padding: 15rpx; border: none; border-radius: 4rpx; flex: 1;" />
		</view>
		<view class="text-area" style="margin-bottom: 20rpx;">
			<text style="font-size: 32rpx; font-weight: 500;">回传值:</text>
			<input type="text" :value="callBackValue"
				style="background-color: #e6e6e6; color: #ffcc00; 
				font-weight: bold; padding: 15rpx; border: none; border-radius: 4rpx; flex: 1;" />
		</view>
		<comA :intent="title"></comA>
		<comB @callBackFun="callBack"></comB>
	</view>
</template>

<script>
	import comA from '../../../components/compA.vue'
	import comB from '../../../components/compB.vue'

	export default {
		components: {
			comA,
			comB
		},
		data() {
			return {
				title: '',
				callBackValue: ''
			};
		},
		methods: {
			callBack(msg) {
				console.warn("---index---callBack--->"+msg);
				this.callBackValue = msg;
			}
		}
	};
</script>

<style>
	.text-area {
		display: flex;
		align-items: center;
		gap: 15rpx;
	}
</style>